package com.huawei.esdk.uc.sametime.preferences;

import org.apache.log4j.Logger;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

import com.huawei.esdk.uc.sametime.EsdkPluginActivator;
import com.huawei.esdk.uc.sametime.international.Messages;

/**
 * This class represents a preference page that is contributed to the
 * Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we
 * can use the field support built into JFace that allows us to create a page
 * that is small and knows how to save, restore and apply itself.
 * <p>
 * This page is used to modify preferences only. They are stored in the
 * preference store that belongs to the main plug-in class. That way,
 * preferences can be accessed directly via the preference store.
 */

public class EsdkPreferencePage extends FieldEditorPreferencePage implements
        IWorkbenchPreferencePage
{
    private static Logger logger = Logger.getLogger(EsdkPreferencePage.class);
    
    public EsdkPreferencePage()
    {
        super(GRID);
        setPreferenceStore(EsdkPluginActivator.getDefault()
                .getPreferenceStore());
        setDescription(Messages.EsdkPreferencePage_DESCRIPTION);
        noDefaultAndApplyButton();

        logger.debug(getDescription());
    }



    /**
     * Creates the field editors. Field editors are abstractions of the common
     * GUI blocks needed to manipulate various types of preferences. Each field
     * editor knows how to save and restore itself.
     */
    public void createFieldEditors()
    {
        //页面中不需要有设置语言的国际化选项了.
    }

    /**
     * 提交“确定”或“应用”按钮，覆盖FieldEditorPreferencePage.performOk方法
     */
    public boolean performOk()
    {
        super.performOk();
        // 这里调用国际化设置接口方法

        return true;
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
     */
    public void init(IWorkbench workbench)
    {
    }

}